/*
 * 新人专区
 * @Author: along
 * @Date: 2020-02-03 17:40
 */
<template>
    <div class="container shopPeoPle">
        <!-- header -->
        <div class="header-nav">
            <div class="header-left">
                <div class="header-box-content">
                    <p class="header-box-title">商品名称:</p>
                    <el-input
                        v-model="head.goods_title"
                        placeholder="请输入要搜索的内容"
                        suffix-icon="el-icon-search"
                        size="small"
                        clearable
                        class="search-ipt"
                        @change="getTableData(1)"
                        @keyup.native.enter="getTableData(1)"
                    />
                </div>
                <div class="header-box-content">
                    <p class="header-box-title">审核状态:</p>
                    <el-select
                        v-model="head.audit_status"
                        filterable
                        placeholder="请选择"
                        size="small"
                        @change="getTableData(1)"
                    >
                        <el-option
                            v-for="item in auditList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                        />
                    </el-select>
                </div>
                <div class="header-box-content">
                    <p class="header-box-title">店铺名称:</p>
                    <el-input
                        v-model="head.shop_title"
                        placeholder="请输入要搜索的内容"
                        suffix-icon="el-icon-search"
                        size="small"
                        clearable
                        class="search-ipt"
                        @change="getTableData(1)"
                        @keyup.native.enter="getTableData(1)"
                    />
                </div>
                <div class="header-box-content">
                    <p class="header-box-title">学校权限:</p>
                    <el-select
                        v-model="head.school_filter_status"
                        filterable
                        placeholder="请选择"
                        size="small"
                        @change="getTableData(1)"
                    >
                        <el-option
                            v-for="item in schoolListData"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                        />
                    </el-select>
                </div>
                <div class="header-box-content">
                    <p class="header-box-title">折扣力度:</p>
                    <el-select
                        v-model="head.discount"
                        filterable
                        placeholder="请选择"
                        size="small"
                        @change="getTableData(1)"
                    >
                        <el-option
                            v-for="item in discountList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                        />
                    </el-select>
                </div>
                <div class="header-box-content">
                    <p class="header-box-title">是否设置学生库存自扣减:</p>
                    <el-select
                        v-model="head.autoinc_student_product_set"
                        filterable
                        placeholder="请选择"
                        size="small"
                        @change="getTableData(1)"
                    >
                        <el-option
                            v-for="item in productList"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value"
                        />
                    </el-select>
                </div>
                <div class="header-box-content">
                    <el-button
                        size="small"
                        type="primary"
                        @click="() => {
                            this.$router.push({
                                name: 'shopPeopleSetting'
                            })
                        }"
                    >
                        售卖递减规则管理
                    </el-button>
                </div>
            </div>
            <!-- <div class="header-right"></div> -->
        </div>
        <!-- /header -->

        <!-- table -->
        <el-table
            :data="tableData"
            height="100%"
            style="width: 100%;"
            border
            ref="shopPeoPle"
            @sort-change="handleSortChanged"
            @select="fnSelect"
            @select-all="fnSelectAllTop"
            @selection-change="handleSelectionChange"
        >
            <el-table-column
                type="selection"
                width="40"
                fixed="left"
            />
            <el-table-column
                prop="goods_title"
                label="商品名称"
                show-overflow-tooltip
                :formatter="emptyFormatter"
                align="center"
                fixed="left"
            />
            <el-table-column
                prop="goods_cover"
                label="商品缩略图"
                show-overflow-tooltip
                :formatter="emptyFormatter"
                align="center"
                :width="110"
            >
                <template slot-scope="scope">
                    <img
                        :src="scope.row.goods_cover"
                        style="width:40px;height:40px"
                    >
                </template>
            </el-table-column>
            <el-table-column
                prop="goods_no"
                label="商品编号"
                show-overflow-tooltip
                :formatter="emptyFormatter"
                align="center"
            />
            <el-table-column
                prop="shop.shop_title"
                label="店铺名称"
                show-overflow-tooltip
                :formatter="emptyFormatter"
                align="center"
            />
            <el-table-column
                prop="goods_price"
                label="折扣价"
                show-overflow-tooltip
                :formatter="emptyFormatter"
                align="center"
                :width="120"
            />
            <el-table-column
                prop="goods_discount"
                label="折扣"
                show-overflow-tooltip
                :formatter="emptyFormatter"
                align="center"
                :width="120"
            >
                <template slot-scope="scope">
                    {{ scope.row.goods_discount }}折
                </template>
            </el-table-column>
            <!-- <el-table-column
                prop="goods_price_origin"
                label="原价"
                show-overflow-tooltip
                :formatter="emptyFormatter"
                align="center"
            /> -->
            <el-table-column
                label="限购数"
                :width="120"
                show-overflow-tooltip
                :formatter="emptyFormatter"
            >
                <template slot-scope="scope">
                    <div class="sort-wrap">
                        {{ scope.row.buy_limit_count | limitFilter }}
                        <span class="sort-spliter" />
                        <el-button
                            type="text"
                            class="btn-sort"
                            @click="fnEditLimit(scope.row.goods_no)"
                        >
                            <i class="el-icon-edit" />
                        </el-button>
                    </div>
                </template>
            </el-table-column>
            <el-table-column
                label="佣金"
                show-overflow-tooltip
                :formatter="emptyFormatter"
            >
                <template slot-scope="scope">
                    <el-popover
                        placement="bottom"
                        trigger="hover"
                    >
                        <div
                            class="spec-list"
                            v-if="scope.row.specList"
                        >
                            <div
                                class="spec-line"
                                v-for="(specItem, specIndex) in scope.row.specList"
                                :key="specIndex"
                            >
                                {{ specItem | specFilter }}
                            </div>
                        </div>
                        <el-button
                            slot="reference"
                            type="text"
                            @mouseover.native="getProduct(scope.row)"
                        >
                            查看
                        </el-button>
                    </el-popover>
                </template>
            </el-table-column>
            <el-table-column
                prop="goods_sort"
                label="排序"
                :width="120"
                sortable="custom"
                align="center"
            >
                <template slot-scope="scope">
                    <div class="sort-wrap">
                        {{ scope.row.goods_sort }}
                        <span class="sort-spliter" />
                        <el-button
                            type="text"
                            class="btn-sort"
                            @click="fnEditSort(scope.row)"
                        >
                            <i class="el-icon-edit" />
                        </el-button>
                    </div>
                </template>
            </el-table-column>
            <el-table-column
                prop="goods_stock"
                label="剩余库存"
                show-overflow-tooltip
                :formatter="emptyFormatter"
                align="center"
            />
            <el-table-column
                label="售卖上限"
                show-overflow-tooltip
                :formatter="emptyFormatter"
                :render-header="renderHeader"
                align="center"
                :width="140"
            >
                <template slot-scope="scope">
                    <p
                        @click="fnSetRest(scope.row)"
                        class="cursor-font"
                    >
                        设置
                    </p>
                </template>
            </el-table-column>
            <el-table-column
                prop="goods_sale"
                label="真实销量"
                show-overflow-tooltip
                align="center"
                sortable="custom"
                :width="100"
            />
            <el-table-column
                prop="goods_view"
                label="真实浏览量"
                show-overflow-tooltip
                align="center"
                :width="120"
                sortable="custom"
            />
            <el-table-column
                prop="goods_view_base"
                label="企业主浏览量"
                show-overflow-tooltip
                align="center"
                :width="130"
                sortable="custom"
            >
                <template slot-scope="scope">
                    {{ scope.row.goods_view_base + scope.row.goods_view }}
                </template>
            </el-table-column>
            <el-table-column
                prop="create_time"
                label="创建日期"
                align="center"
                show-overflow-tooltip
                :formatter="emptyFormatter"
                :width="150"
            >
                <template slot-scope="scope">
                    {{ scope.row.create_time * 1000 | dateFormatter('yyyy/MM/dd HH:mm') }}
                </template>
            </el-table-column>
            <el-table-column
                prop="audit_status"
                label="审核状态"
                show-overflow-tooltip
                :formatter="emptyFormatter"
            >
                <template slot-scope="scope">
                    <span v-if="scope.row.audit_status == 1">已通过</span>
                    <span v-if="scope.row.audit_status == -1">未通过</span>
                    <span v-if="scope.row.audit_status == 0">待审核</span>
                </template>
            </el-table-column>
            <el-table-column
                prop="school_filter_status"
                label="是否设置学校权限"
                show-overflow-tooltip
                :formatter="emptyFormatter"
                :width="140"
                align="center"
            >
                <template slot-scope="scope">
                    <span
                        v-if="scope.row.school_filter_status == 1"
                        class="cursor-font"
                        @click="fnSetAuthor(scope.row)">是</span>
                    <span v-if="scope.row.school_filter_status == 0">否</span>
                </template>
            </el-table-column>
            <el-table-column
                prop="autoinc_sale"
                align="center"
                width="170"
                label="是否销量自增长"
                show-overflow-tooltip
            >
                <template slot-scope="scope">
                    <span v-if="scope.row.autoinc_sale.autoinc_no == ''">
                        否
                    </span>
                    <span v-if="scope.row.autoinc_sale.autoinc_no !== ''">
                        是（{{ scope.row.autoinc_sale.inc_count_min ? scope.row.autoinc_sale.inc_count_min * 24 : 0 }} - {{ scope.row.autoinc_sale.inc_count_max ? scope.row.autoinc_sale.inc_count_max * 24 : 0 }} 个/天）
                    </span>
                </template>
            </el-table-column>
            <el-table-column
                prop="autoinc_student_product"
                align="center"
                width="170"
                label="是否库存自扣减"
                show-overflow-tooltip
            >
                <template slot-scope="scope">
                    <span v-if="scope.row.autoinc_student_product.autoinc_no == ''">
                        否
                    </span>
                    <span v-if="scope.row.autoinc_student_product.autoinc_no !== ''">
                        是（{{ scope.row.autoinc_student_product.inc_count_min ? scope.row.autoinc_student_product.inc_count_min * 12 : 0 }} - {{ scope.row.autoinc_student_product.inc_count_max ? scope.row.autoinc_student_product.inc_count_max * 12 : 0 }} 个/天）
                    </span>
                </template>
            </el-table-column>
            <el-table-column
                prop="autoinc_view"
                align="center"
                width="170"
                label="是否浏览量自增长"
                show-overflow-tooltip
            >
                <template slot-scope="scope">
                    <span v-if="scope.row.autoinc_view.autoinc_no == ''">
                        否
                    </span>
                    <span v-if="scope.row.autoinc_view.autoinc_no !== ''">
                        是（{{ scope.row.autoinc_view.inc_count_min ? scope.row.autoinc_view.inc_count_min * 24 : 0 }} - {{ scope.row.autoinc_view.inc_count_max ? scope.row.autoinc_view.inc_count_max * 24 : 0 }} 个/天）
                    </span>
                </template>
            </el-table-column>
            <el-table-column
                label="操作"
                align="center"
                fixed="right"
                :width="120"
            >
                <template slot-scope="scope">
                    <el-button
                        type="text"
                        class="curse-add"
                        :disabled="scope.row.audit_status == 1"
                        @click='fnUpperShelf(scope.row, 1)'
                    >
                        通过
                    </el-button>
                    <el-button
                        type="text"
                        class="curse-add"
                        :disabled="scope.row.audit_status == -1"
                        @click='fnUpperShelf(scope.row, -1)'
                    >
                        不通过
                    </el-button>
                    <el-button
                        type="text"
                        class="curse-add"
                        @click="fnGophmin(scope.row)"
                    >
                        编辑
                    </el-button>
                    <el-button
                        type="text"
                        class="curse-add"
                        @click="fnSetAuthor(scope.row)"
                    >
                        设置学校权限
                    </el-button>
                </template>
            </el-table-column>
        </el-table>
        <!-- /table -->

        <!-- 审核不通过 -->
        <el-dialog
            title="*请认真填写不通过的理由*"
            width="530px"
            custom-class="schedule-dialog"
            :visible.sync="showDilog"
        >
            <el-form
                :model="ruleFormReason"
                :rules="rulesReason"
                ref="ruleFormReason"
            >
                <el-form-item
                    prop='text'
                >
                    <el-input
                        type="textarea"
                        :autosize="{ minRows: 2, maxRows: 6}"
                        placeholder="不通过理由"
                        v-model="ruleFormReason.text"
                    />
                </el-form-item>
            </el-form>
            <div
                slot="footer"
                class="dialog-footer"
            >
                <el-button
                    size="small"
                    type="primary"
                    @click="submitFormReason('ruleFormReason')">提交</el-button>
            </div>
        </el-dialog>
        <!-- /审核不通过 -->

        <!-- 选择学校 -->
        <el-dialog
            title="选择学校"
            width="1048px"
            custom-class="choose-dialog"
            :visible.sync="showChooseSchool"
        >
            <el-cascader
                v-model="selectedCity"
                placeholder="请选择城市"
                :options="cities"
                :props="props"
                filterable
                size="small"
                style="width: 120px;marginBottom:15px"
                @change="fnChangeCity"
            />
            <el-input
                placeholder="请输入搜索内容"
                v-model.trim="searchKey"
                size="small"
                style="width: 380px"
                @keyup.native.enter="fnSearchSchool()"
            >
                <el-button
                    slot="append"
                    icon="el-icon-search"
                    @click="fnSearchSchool()"
                />
            </el-input>
            <div
                class="el-tag-school"
                v-if="isSchool"
            >
                <el-tag
                    :key="tag"
                    v-for="tag in selectedSchools"
                    closable
                    :disable-transitions="false"
                    @close="handleCloseSchool(tag)"
                >
                    {{ JSON.parse(tag).name }}
                </el-tag>
            </div>
            <div class="splider" />
            <div class="school-list">
                <div
                    class="empty"
                    v-if="schoolList.length <= 0"
                >
                    请切换城市
                </div>
                <el-checkbox-group
                    v-model="selectedSchools"
                    size="small"
                    v-else
                >
                    <el-checkbox-button
                        v-for="(school, schoolIndex) in schoolList"
                        :label="JSON.stringify({
                            id: school.id,
                            name: school.name
                        })"
                        :key="schoolIndex"
                    >{{ school.name }}</el-checkbox-button>
                </el-checkbox-group>
            </div>
            <div
                class="el-school-filter"
            >
                <p style="color:#7e8993;paddingRight:8px">设置学校权限:</p>
                <el-switch
                    v-model="filter_status"
                    active-color="#13ce66"
                    :active-value="1"
                    :inactive-value="0"
                />
            </div>
            <el-button
                type="primary"
                size="small"
                class="submit-btn"
                @click="fnSchooldAuthor()"
            >确定</el-button>
        </el-dialog>
        <!-- 选择学校 -->

        <!-- 设置商品自动增长 -->
        <el-dialog
            title="自动增长量"
            :visible.sync="dialogVisiblBrowse"
            width="510px"
        >
            <div
                style="marginBottom: 15px;marginLeft:30px;"
                v-for="(item,index) in browseList"
                :key="index"
            >
                <el-radio
                    v-model="browse"
                    :label="item.autoinc_no"
                >
                    <span>{{ item.inc_count_min }} - {{ item.inc_count_max }}个/小时</span>
                </el-radio>
            </div>
            <span
                slot="footer"
                class="dialog-footer">
                <el-button
                    @click="dialogVisiblBrowse = false"
                    size="small"
                >取 消</el-button>
                <el-button
                    type="primary"
                    size="small"
                    @click="fnConfirmBrowse()">确 定</el-button>
            </span>
        </el-dialog>
        <!-- /设置商品自动增长 -->

        <!-- 设置商品库存扣减 -->
        <el-dialog
            title="商品库存扣减"
            :visible.sync="dialogVisiblAutoinc"
            width="510px"
        >
            <div
                style="marginBottom: 15px;marginLeft:30px;"
                v-for="(item,index) in autoIncList"
                :key="index"
            >
                <el-radio
                    v-model="autoInc"
                    :label="item.autoinc_no"
                >
                    <span>{{ item.inc_count_min }} - {{ item.inc_count_max }}个/小时</span>
                </el-radio>
            </div>
            <span
                slot="footer"
                class="dialog-footer">
                <el-button
                    @click="dialogVisiblAutoinc = false"
                    size="small"
                >取 消</el-button>
                <el-button
                    type="primary"
                    size="small"
                    @click="fnConfirmInc()">确 定</el-button>
            </span>
        </el-dialog>
        <!-- /设置商品自动增长 -->

        <!-- 设置每日售卖量 -->
        <el-dialog
            title="售卖上限"
            :visible.sync="dialogVisibleSale"
            width="714px"
            class="dialogVisibleSale"
        >
            <p class="title">售量卖完，每日10点会从库存自动补充</p>
            <div class="sale_wrap">
                <div class="header">
                    <p class="header_title">商品名称: {{ sale_title }}</p>
                </div>
                <el-table
                    :data="saleList"
                    height="100%"
                    style="width: 100%;max-height:400px"
                    border
                >
                    <el-table-column
                        prop="spec_list"
                        label="规格信息"
                        show-overflow-tooltip
                        :formatter="emptyFormatter"
                        align="left"
                    >
                        <template slot-scope="scope">
                            {{ scope.row.spec_list | filterSpec }}
                        </template>
                    </el-table-column>
                    <el-table-column
                        prop="product_stock"
                        label="产品库存"
                        show-overflow-tooltip
                        :formatter="emptyFormatter"
                        align="left"
                    />
                    <el-table-column
                        label="用户端展示库存"
                        show-overflow-tooltip
                        :formatter="emptyFormatter"
                        align="left"
                    >
                        <template slot-scope="scope">
                            <el-input
                                v-model="scope.row.student_stock_replenish"
                                size="small"
                            />
                        </template>
                    </el-table-column>
                </el-table>
                <span
                    slot="footer"
                    class="dialog-footer"
                >
                    <el-button
                        @click="dialogVisibleSale = false"
                        size="medium"
                        :style="{width: '120px', marginRight: '32px'}"
                    >
                        取 消
                    </el-button>
                    <el-button
                        type="primary"
                        size="medium"
                        :style="{width: '120px'}"
                        @click="confirmSale()"
                    >
                        确 定
                    </el-button>
                </span>
            </div>
        </el-dialog>

        <!-- /分页 -->
        <div class="pagination-wrapper clearfix">
            <div class="el-pagage-wrap">
                <div class="el-page-box">
                    <el-checkbox
                        v-model="checkedAll"
                        :indeterminate="checkIndeterminate"
                        @change="fnChangeChecked">全选</el-checkbox>
                    <div class="el-pagage-cont">
                        <el-dropdown
                            :hide-on-click="false"
                            :class="multipleSelection.length == 0 ? '' : 'el-pagage-cursor'"
                            @command="handleCommand"
                        >
                            <span class="el-dropdown-link">
                                商品批量操作选项
                            </span>
                            <el-dropdown-menu slot="dropdown">
                                <el-dropdown-item
                                    v-for="(item,index) in ['批量审核通过','设置学校权限','添加库存扣减','移除库存扣减','添加自动销量','移除自动销量','添加浏览量','移除浏览量','设置限购数']"
                                    :key="index"
                                    :command="item"
                                >
                                    {{ item }}
                                </el-dropdown-item>
                            </el-dropdown-menu>
                        </el-dropdown>
                    </div>
                </div>
                <el-pagination
                    background
                    layout="total, prev, pager, next"
                    :total="page.total_count"
                    :page-size="page.page_size"
                    :current-page="page.now_page"
                    @current-change="getTableData"
                />
            </div>
        </div>
    </div>
</template>

<script>
import { back } from '@/mixin/back';

const SALE_DIALOG = {
    dialogVisibleSale: false,
    sale_title: '',
    saleList: [],
    sale_dock_no: ''
};

const AUTOINCC = {
    dialogVisiblAutoinc: false,
    autoIncList: [],
    autoInc: []
};

export default {
    mixins: [back],
    data () {
        return {
            ...AUTOINCC,
            ...SALE_DIALOG,
            showDilog: false,
            ruleFormReason: {
                text: ''
            },
            rulesReason: {
                text: [
                    { required: true, message: '请填写不通过理由', trigger: 'blur' }
                ]
            },
            goods_no: '',
            head: {
                goods_title: '',
                audit_status: 99,
                shop_title: '',
                school_filter_status: 99,
                discount: 0,
                autoinc_student_product_set: 99
            },
            auditList: [{
                value: 99,
                label: '全部'
            },{
                value: 0,
                label: '待审核'
            },{
                value: 1,
                label: '审核通过'
            },{
                value: -1,
                label: '审核不通过'
            }],
            schoolListData: [{
                value: 99,
                label: '全部'
            },{
                value: 1,
                label: '是'
            },{
                value: 0,
                label: '否'
            }],
            productList: [{
                value: 99,
                label: '全部'
            },{
                value: 1,
                label: '是'
            },{
                value: 0,
                label: '否'
            }],
            checkIndeterminate: false,
            multipleSelection: [],
            checkedAll: false,
            page: {
                now_page: 1,
                total_count: 0,
                page_size: 0
            },
            pathName: '',
            tableData: [],
            authResult: {},
            filterData: {
                sort_field: 0,
                sort_type: 0
            },
            indexError: 0,
            //学校权限
            school_filter_status: 99,
            filter_status: 1,
            isSchool: true,
            showChooseSchool: false,
            selectedCity: [],
            cities: [],
            searchKey: '',
            schoolList: [],
            // 当前选中的学校
            selectedSchools: [],
            //所有学校集合
            city_schools: {},
            props: {
                value: 'id',
                label: 'name',
                children: 'children'
            },
            //销量浏览量
            dialogVisiblBrowse: false,
            add_shop_type: '',
            browse: '',
            browseList: [],
            //折扣
            discountList: [{
                value: 0,
                label: '全部'
            },{
                value: 1,
                label: '一折'
            },{
                value: 2,
                label: '二折'
            },{
                value: 3,
                label: '三折'
            },{
                value: 4,
                label: '四折'
            },{
                value: 5,
                label: '五折'
            },{
                value: 6,
                label: '六折'
            },{
                value: 7,
                label: '七折'
            },{
                value: 8,
                label: '八折'
            },{
                value: 9,
                label: '九折'
            },{
                value: 10,
                label: '十折'
            }]
        };
    },
    filters: {
        limitFilter(val){
            if(val <= -1){
                return '不限购';
            }
            return val;
        },
        specFilter(val){
            if(!val){
                return '--';
            }
            let str = '';

            for(var i in val.spec_list){
                str += val.spec_list[i].spec_name + ':' + val.spec_list[i].spec_value;
                if(i < val.spec_list.length){
                    str += ',';
                }else{
                    str += ': ';
                }
            }

            if(str){
                str += '佣金' + val.product_commission+'元';
            }
            return str;
        },
        filterSpec (val) {
            if(!val){
                return '--';
            }
            let str = '';

            for(var i in val){
                str += val[i].spec_name + ':' + val[i].spec_value;
                if(i < val.length){
                    str += ';';
                }else{
                    str += ': ';
                }
            }
            return str;
        }
    },
    computed: {},
    watch: {
        showDilog (val) {
            if (!val) {
                this.ruleFormReason = {
                    text: ''
                };
                this.goods_no = '';
            }
        },
        showChooseSchool (val) {
            this.fnGetSchoolList();
        },
    },
    mounted () {
        this.authResult = this.$route.meta.authResult;

        //商城大盘数据匹配
        if(this.$route.query.title) {
            this.head.goods_title = this.$route.query.title;
        }

        this.fnBreadcrumb();
        this.getTableData();
        this.fnGetSchoolList();
    },
    methods: {
        /**
         * 设置表单header
         */
        fnBreadcrumb () {
            this.$store.commit('SET_HEADER', [{ title: "APP后台"},{title: '商城'},{title: '新人专区'}]);
        },

        /**
         * 获取表格数据
         */
        getTableData (page) {
            this.$post('/student/shop_goods%5Cget_new_user_goods_list', {
                page_id: page || this.page.now_page,
                goods_title: this.head.goods_title,
                shop_title: this.head.shop_title,
                audit_status: this.head.audit_status,
                school_filter_status: this.head.school_filter_status,
                sort_field: this.filterData.sort_field,
                sort_type: this.filterData.sort_type,
                goods_discount: this.head.discount,
                autoinc_student_product_set: this.head.autoinc_student_product_set
            }, resp => {
                if (resp.code == 1) {
                    this.tableData = resp.data.list;
                    this.page.now_page = resp.data.page.now_page;
                    this.page.total_count = resp.data.page.total_count;
                    this.page.page_size = resp.data.page.page_size;
                }
            });
        },

        /**
         * 获取商品销量套餐
         */
        fnGetAutoinc (param) {
            this.browseList = [];
            if (param == 1) {
                this.$post('/student/shop_goods_sale_autoinc%5Cget_list', {
                }, resp => {
                    if (resp.code == 1) {
                        this.browseList = resp.data.list;
                    }
                });
            } else {
                this.$post('/student/shop_goods_view_autoinc%5Cget_list', {
                }, resp => {
                    if (resp.code == 1) {
                        this.browseList = resp.data.list;
                    }
                });
            }

        },

        /**
         * 1:添加自动销量 2:自动浏览量
         */
        fnAddVolum (param) {
            if (param == 1) {
                this.fnGetAutoinc(1);
                let list = this.multipleSelection;

                this.add_shop_type = 1;
                for(let i=0; i<list.length;i++) {
                    if (list[i].goods_type == 2 || list[i].goods_type == 3) {
                        this.$message({
                            type: 'waring',
                            message: '销量自增长,只对自营商品和商圈商品有效,请重新选择商品',
                            center: true
                        });
                        return;
                    }
                }
            } else {
                this.add_shop_type = 2;
                this.fnGetAutoinc(2);
            }
            this.dialogVisiblBrowse = !this.dialogVisiblBrowse;
        },

        /**
         * 移除自动销量
         */
        fnRemoveVolum (param) {
            let list = this.multipleSelection;

            if (param == 1) {
                for(let i=0; i<list.length;i++) {
                    if (list[i].goods_type == 2 || list[i].goods_type == 3) {
                        this.$message({
                            type: 'waring',
                            message: '销量自增长,只对自营商品和商圈商品有效,请重新选择商品',
                            center: true
                        });
                        return;
                    }
                }
            }

            this.$confirm('此操作将移除所选中商品增长量, 是否继续?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                if (param == 1) {
                    this.multipleSelection.map(item=>{
                        if (item.autoinc_sale.autoinc_no !== '') {
                            this.multipleSelection.map(item=> {
                                this.$post('/student/shop_goods_sale_autoinc%5Cunset_autoinc',{
                                    goods_no: item.goods_no
                                },resp=>{
                                    if (resp.code == 1) {
                                        //
                                    } else {
                                        this.$message({
                                            type: 'waring',
                                            message: resp.msg,
                                            center: true
                                        });
                                    }
                                });
                            });
                        }
                    });
                } else {
                    this.multipleSelection.map(item=>{
                        if (item.autoinc_sale.autoinc_no !== '') {
                            this.multipleSelection.map(item=> {
                                this.$post('/student/shop_goods_view_autoinc%5Cunset_autoinc',{
                                    goods_no: item.goods_no
                                },resp=>{
                                    if (resp.code == 1) {
                                        //
                                    } else {
                                        this.$message({
                                            type: 'waring',
                                            message: resp.msg,
                                            center: true
                                        });
                                    }
                                });
                            });
                        }
                    });
                }

                setTimeout(() => {
                    this.getTableData();
                    this.$message({
                        type: 'success',
                        message: '移除成功',
                        center: true
                    });
                },500);
            });
        },

        /**
         * 确定设置商品销量
         */
        fnConfirmBrowse () {
            if (this.browse == '') {
                this.$message({
                    type: 'waring',
                    message: '不可以为空,请选择自动增长量',
                    center: true
                });
                return;
            }

            if (this.add_shop_type == 1) {
                this.multipleSelection.map(item=> {
                    this.$post('/student/shop_goods_sale_autoinc%5Cset_autoinc',{
                        autoinc_no: this.browse,
                        goods_no: item.goods_no
                    },resp=>{
                        if (resp.code == 1) {
                            //
                        } else {
                            this.$message({
                                type: 'waring',
                                message: resp.msg,
                                center: true
                            });
                        }
                    });
                });
            } else if (this.add_shop_type == 2) {
                this.multipleSelection.map(item=> {
                    this.$post('/student/shop_goods_view_autoinc%5Cset_autoinc',{
                        autoinc_no: this.browse,
                        goods_no: item.goods_no
                    },resp=>{
                        if (resp.code == 1) {
                            //
                        } else {
                            this.$message({
                                type: 'waring',
                                message: resp.msg,
                                center: true
                            });
                        }
                    });
                });
            } else {
                return;
            }

            setTimeout(() => {
                this.dialogVisiblBrowse = !this.dialogVisiblBrowse;
                this.getTableData();
                this.$message({
                    type: 'success',
                    message: '设置成功',
                    center: true
                });
            }, 500);
        },

        /**
         * 获取商品规格信息
         */
        getProduct (row) {
            this.$post('/student/shop_goods%5Cget', {
                goods_no: row.goods_no
            }, resp=> {
                if (resp.code == 1) {
                    let spec = resp.data.goods_product_list;

                    this.$set(row, 'specList', spec);
                } else if (resp.code == 0) {
                    return;
                }
            });
        },
        fnEditLimitBatch(){
            let ids = this.multipleSelection.reduce((res, item) => {
                res.push(item.goods_no);
                return res;
            }, []);

            this.fnEditLimit(ids.toString());
        },
        fnEditLimit(ids){
            this.$prompt('请输入限购数', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                inputPattern: /^-?[0-9]{1,6}$/,
                inputErrorMessage: '请输入正确的数值, 最大999999'
            }).then(({ value }) => {
                this.$post('/student/shop_goods%5Cset_buy_limit_count',{
                    goods_nos: ids,
                    buy_limit_count : value
                },resp=>{
                    if (resp.code == 1) {
                        this.getTableData();
                        this.$message({
                            type: 'success',
                            message: '操作成功'
                        });
                    } else if (resp.code == 0) {
                        this.$message({
                            type: 'warning',
                            message: resp.msg
                        });
                    }
                });
            });
        },
        /**
         * 排序
         */
        fnEditSort (row) {
            this.$prompt('请输入排序号', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                inputPattern: /^([1-9]\d?|[1-9]\d+)$/,
                inputErrorMessage: '排序号格式不正确,请重新输入'
            }).then(({ value }) => {
                this.$post('/student/shop_goods%5Cmodify',{
                    goods_no: row.goods_no,
                    goods_sort: value
                },resp=>{
                    if (resp.code == 1) {
                        this.getTableData();
                        this.$message({
                            type: 'success',
                            message: '操作成功'
                        });
                    } else if (resp.code == 0) {
                        this.$message({
                            type: 'warning',
                            message: resp.msg
                        });
                    }
                });
            });
        },

        /**
         * 审核通过/不通过
         */
        fnUpperShelf (row, status) {
            let audit = status == 1 ? 1 : -1;

            if (audit == 1) {
                this.$post('/student/shop_goods%5Caudit', {
                    goods_no: row.goods_no,
                    action : 'pass'
                }, resp=> {
                    if (resp.code == 1) {
                        this.getTableData();
                        this.$message({
                            type: 'success',
                            message: '操作成功'
                        });
                    } else if (resp.code == 0) {
                        this.$message({
                            type: 'waring',
                            message: resp.msg
                        });
                    }
                });
            } else {
                this.goods_no = row.goods_no;
                this.showDilog = !this.showDilog;
            }
        },

        /**
         * 提交不通过理由
         */
        submitFormReason (formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    this.$post('/student/shop_goods%5Caudit', {
                        goods_no: this.goods_no,
                        action : 'fail',
                        reason: this.ruleFormReason.text
                    }, resp=> {
                        if (resp.code == 1) {
                            this.showDilog = !this.showDilog;
                            this.getTableData();
                            this.$message({
                                type: 'success',
                                message: '操作成功'
                            });
                        } else if (resp.code == 0) {
                            this.$message({
                                type: 'waring',
                                message: resp.msg
                            });
                        }
                    });
                } else {
                    console.log('error submit!!');
                    return false;
                }
            });
        },

        /**
         * 编辑
         */
        fnGophmin (row) {
            this.$post('/wei4/hire_user%5Cget_login_session_ticket', {
                hire_no: row.hire_no
            }, resp => {
                if (resp.code == 1) {
                    window.open(`${this.$shopBaseUrl}/manage/market/good-edit-people?no=${row.goods_no}&session_ticket=` + resp.data.session_ticket);
                    // if(window.location.host == 'phaadmin.wxhand.com') {
                    //     window.open(`http://cms.zsdx.cn/manage/market/good-edit-people?no=${row.goods_no}&session_ticket=` + resp.data.session_ticket);
                    // }else{
                    //     window.open(`http://gt.wxhand.com/manage/market/good-edit-people?no=${row.goods_no}&session_ticket=` + resp.data.session_ticket);
                    // }
                } else {
                    this.$message({
                        type: 'warning',
                        message: resp.msg,
                        center: true
                    });
                }
            });
        },

        /**
         * 批量通过
         */
        fnUpperShelfCheck () {
            this.multipleSelection.map(item => {
                this.$post('/student/shop_goods%5Caudit', {
                    goods_no: item.goods_no,
                    action : 'pass'
                }, resp=> {
                    if (resp.code == 1) {
                        //
                    } else if (resp.code == 0) {
                        this.indexError ++;
                    }
                });
            });

            setTimeout(()=>{
                if (this.indexError > 0) {
                    this.$message({
                        type: 'waring',
                        message: `失败${this.indexError}个`
                    });
                } else {
                    this.$message({
                        type: 'success',
                        message: '操作成功'
                    });
                }
                this.getTableData();
                this.indexError = 0;
            },150);
        },

        /**
         * 学校权限
         */
        fnChangeCity() {
            if (this.selectedCity.length >= 2) {
                this.schoolList = this.city_schools['city_' + this.selectedCity[1]];
                this.searchKey = '';
            } else {
                this.schoolList = [];
                this.searchKey = '';
            }
        },
        fnSearchSchool() {
            if (this.selectedCity.length >= 2) {
                this.schoolList = this.city_schools['city_' + this.selectedCity[1]].filter(item => {
                    if (!this.searchKey) {
                        return true;
                    }
                    return item.name.indexOf(this.searchKey) > -1;
                });
            } else {
                this.schoolList = [];
            }
        },
        fnGetSchoolList() {
            this.$post('/student/local_info%5Cschool_tree', {
            }, resp => {
                if (resp.code == 1) {
                    // 将学校与省市剥离,方便显示以及遍历
                    let tree = resp.data.tree;
                    let cityTmp = [];
                    let schoolTmp = {};

                    tree.forEach(item => {
                        let provinceTmp = {
                            id: item.id,
                            name: item.name,
                            children: []
                        };

                        if (item.children) {
                            item.children.forEach((city) => {
                                provinceTmp.children.push({
                                    id: city.id,
                                    name: city.name
                                });
                                schoolTmp['city_' + city.id] = city.children;
                            });
                        }
                        cityTmp.push(provinceTmp);
                    });

                    this.cities = cityTmp;
                    this.city_schools = schoolTmp;
                    this.selectedCity = [12, 88];
                    this.fnChangeCity();
                }
            });
        },

        /**
         * @description 添加商品库存扣减
         */
        fnSetAutoinc () {
            this.$post('/student/shop_goods_student_product_autoinc%5Cget_list',{},resp => {
                if (resp.code == 1) {
                    this.autoIncList = resp.data.list;
                    this.dialogVisiblAutoinc = !this.dialogVisiblAutoinc;
                } else {
                    this.$message({
                        type: 'waring',
                        message: resp.msg,
                        center: true
                    });
                }
            });
        },

        /**
         * @description 移除商品库存扣减
         */
        fnRelAutoinc () {
            let goods = this.multipleSelection.reduce((cur,next) => {
                cur.push(next.goods_no);
                return cur;
            },[]);

            goods.forEach(option => {
                this.$post('/student/shop_goods_student_product_autoinc%5Cunset_autoinc',{
                    goods_no: option
                },resp => {
                    if (resp.code == 1) {
                        //
                    }
                });
            });

            setTimeout(()=>{
                this.getTableData(1);
                this.$message({
                    type: 'success',
                    message: '操作成功',
                    center: true
                });
            },500);
        },

        /**
         * @description 确定扣减
         */
        fnConfirmInc () {
            if(this.autoInc == '') {
                this.$message({
                    type: 'waring',
                    message: '请先选择自动扣减量,不可以为空',
                    center: true
                });
                return false;
            }

            let goods = this.multipleSelection.reduce((cur,next) => {
                cur.push(next.goods_no);
                return cur;
            },[]);

            goods.forEach(option => {
                this.$post('/student/shop_goods_student_product_autoinc%5Cset_autoinc',{
                    autoinc_no: this.autoInc,
                    goods_no: option
                },resp => {
                    if (resp.code == 1) {
                        //
                    }
                });
            });

            setTimeout(()=>{
                this.getTableData(1);
                this.dialogVisiblAutoinc = !this.dialogVisiblAutoinc;
                this.$message({
                    type: 'success',
                    message: '操作成功',
                    center: true
                });
            },500);
        },

        /**
         * 批量设置学校权限
         */
        fnSetSchool () {
            this.isSchool = false;
            this.selectedSchools = [];
            this.showChooseSchool = !this.showChooseSchool;
        },

        /**
         * 移除学校
         */
        handleCloseSchool (tag) {
            this.selectedSchools.splice(this.selectedSchools.indexOf(tag), 1);
        },

        /**
         * 单个设置学校权限
         */
        fnSetAuthor (row) {
            this.goods_no = row.goods_no;
            this.isSchool = true;
            this.$post('/student/shop_goods%5Cget_school_filter',{
                goods_no: row.goods_no,
            },resp => {
                if (resp.code == 1) {
                    let school = [];

                    this.showChooseSchool = !this.showChooseSchool;
                    setTimeout(()=> {
                        this.filter_status = resp.data.school_filter_status;
                        resp.data.school_filter_school_ids.map(item => {
                            this.schoolList.map(option => {
                                if (item == option.id) {
                                    school.push(JSON.stringify({
                                        id: option.id,
                                        name: option.name
                                    }));
                                }
                            });
                        });
                        this.selectedSchools = school;
                    },100);

                } else {
                    this.$message({
                        type: 'waring',
                        message: resp.msg,
                        center: true
                    });
                }
            });
        },

        /**
         * 确定设置过滤学校
         */
        fnSchooldAuthor () {
            let school_filter_school_ids = [];

            if (Object.keys(this.selectedSchools).length >= 1 ) {
                this.selectedSchools.map(item=>{
                    school_filter_school_ids.push(
                        JSON.parse(item).id
                    );
                });
            }

            if (this.isSchool) {
                this.$post('/student/shop_goods%5Cset_school_filter',{
                    goods_no: this.goods_no,
                    school_filter_status: this.filter_status,
                    school_filter_school_ids: school_filter_school_ids.length > 0 ? school_filter_school_ids.join() : ''
                },resp => {
                    if (resp.code == 1) {
                        this.getTableData();
                        this.showChooseSchool = !this.showChooseSchool;
                        this.$message({
                            type: 'success',
                            message: '设置成功',
                            center: true
                        });
                    } else {
                        this.$message({
                            type: 'waring',
                            message: resp.msg,
                            center: true
                        });
                    }
                });
            } else {
                this.multipleSelection.map(item => {
                    this.$post('/student/shop_goods%5Cset_school_filter',{
                        goods_no: item.goods_no,
                        school_filter_status: this.filter_status,
                        school_filter_school_ids: school_filter_school_ids.length > 0 ? school_filter_school_ids.join() : ''
                    },resp => {
                        if (resp.code == 1) {
                            this.getTableData();
                        } else {
                            this.indexError ++;

                        }
                    });
                });

                setTimeout(()=>{
                    if (this.indexError > 0) {
                        this.$message({
                            type: 'waring',
                            message: `设置失败${this.indexError}个`,
                            center: true
                        });
                    } else {
                        this.$message({
                            type: 'success',
                            message: '设置成功',
                            center: true
                        });
                    }
                    this.indexError = 0;
                    this.showChooseSchool = !this.showChooseSchool;
                },500);
            }
        },

        /**
         * @description 全选列表操作
         */
        handleCommand (command) {
            if(this.multipleSelection.length == 0) {
                this.$message({
                    type: 'warning',
                    message: '请先选择商品'
                });
                return false;
            }

            if(command == '批量审核通过') {
                this.fnUpperShelfCheck();
            } else if (command == '设置学校权限') {
                this.fnSetSchool();
            } else if (command == '添加库存扣减') {
                this.fnSetAutoinc();
            } else if (command == '移除库存扣减') {
                this.fnRelAutoinc();
            } else if (command == '添加自动销量') {
                this.fnAddVolum(1);
            } else if (command == '移除自动销量') {
                this.fnRemoveVolum(1);
            } else if (command == '添加浏览量') {
                this.fnAddVolum(2);
            } else if (command == '移除浏览量') {
                this.fnRemoveVolum(2);
            } else if (command == '设置限购数') {
                this.fnEditLimitBatch();
            }
        },

        /**
         * @description 获取商品规格信息
         */
        getProductList (row) {
            return new Promise((resolve,reject) => {
                this.$post('/student/shop_goods%5Cget_product', {
                    goods_no: row.goods_no
                }, resp=> {
                    if (resp.code == 1) {
                        resolve(resp.data.goods_product_list);

                    } else if (resp.code == 0) {
                        return;
                    }
                });
            });
        },

        /**
         * @description 打开每日售卖弹窗
         */
        fnSetRest (row) {
            this.sale_dock_no = row.goods_no;
            this.sale_title = row.goods_title;

            this.getProductList(row).then(resp => {
                let list = JSON.parse(JSON.stringify(resp));

                list.forEach(item => {
                    if(item.student_stock_replenish == -1) {
                        item.student_stock_replenish = item.product_stock;
                    }
                });

                this.saleList = list;
                this.dialogVisibleSale = !this.dialogVisibleSale;
            });
        },

        /**
         * @description 确定设置每日售卖量
         */
        confirmSale () {
            let product_info = this.saleList.reduce((cur,next) => {
                cur.push({
                    product_no: next.product_no,
                    student_stock_replenish: next.student_stock_replenish
                });
                return cur;
            },[]);

            this.$post('/student/shop_goods%5Cset_product',{
                goods_no: this.sale_dock_no,
                product_info: JSON.stringify(product_info)
            },resp=>{
                if (resp.code == 1) {
                    this.dialogVisibleSale = !this.dialogVisibleSale;
                    this.getTableData();
                    this.$message({
                        type: 'success',
                        message: '设置成功'
                    });
                } else if (resp.code == 0) {
                    this.$message({
                        type: 'warning',
                        message: resp.msg
                    });
                }
            });
        },

        /**
         * 获取路由参数
         */
        fnParamUrl () {
            let query = this.$route.query;
        },

        /**
         * 选择Checkbox
         */
        fnSelect(selection) {
            if(selection.length == this.tableData.length) {
                this.checkedAll = true;
            }else{
                this.checkedAll = false;
            }
            if(selection.length > 0 && selection.length < this.tableData.length) {
                this.checkIndeterminate = true;
            }else{
                this.checkIndeterminate = false;
            }
        },
        fnSelectAllTop(selection) {
            if(selection.length > 0) {
                this.checkedAll = true;
            }else{
                this.checkedAll = false;
            }
            if(selection.length > 0 && selection.length < this.tableData.length) {
                this.checkIndeterminate = true;
            }else{
                this.checkIndeterminate = false;
            }
        },
        fnChangeChecked() {
            if(this.checkedAll){
                this.toggleSelection(1);
            }else{
                this.toggleSelection();
            }
        },
        toggleSelection(rows) {
            if (rows) {
                this.$refs.shopPeoPle.toggleAllSelection();
            } else {
                this.$refs.shopPeoPle.clearSelection();
            }
        },
        handleSelectionChange(val) {
            this.multipleSelection = val;
        },

        /**
         * 排序
         */
        handleSortChanged(data) {
            let sortTypeMap = {
                ascending: 0,
                descending: 1
            };

            let sortFieldMap = {
                goods_sale: 1,
                goods_view: 2,
                goods_sort: 3,
                goods_view_base: 4,
            };

            if (data.order) {
                this.filterData.sort_field = sortFieldMap[data.prop];
                this.filterData.sort_type = sortTypeMap[data.order];
            } else {
                this.filterData.sort_field = 0;
                this.filterData.sort_type = 0;
            }

            this.getTableData();
        },

        /**
         * 设置表头
         */
        renderHeader (h) {
            return h('span', {}, [
                h('span', {}, '售卖上限'),
                h('el-popover', { props: { placement: 'top-start', popperClass: 'popoverMain', width: '200', trigger: 'hover', content: '商品中设置的每个规格的“售卖上限”售罄后会在隔日的早上10点自动从商家实际库存补充设置的“售卖上限”。' }}, [
                    h('i', { slot: 'reference', class:'el-icon-question'}, '')
                ])
            ]);
        },

        /**
         * 过滤函数
         */
        emptyFormatter(row, column, val) {
            if (!val) return '--';
            return val;
        }
    }
};
</script>

<style lang="less" scoped>
    .container {
        background-color: #fff;
        padding: 10px 15px 5px 15px;
        display: flex;
        flex-direction: column;
        position: relative;
        width: 100%;
        .header-nav {
            position: relative;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            .header-left, .header-right {
                display: flex;
                align-items: center;
                flex-wrap: wrap;
            }
            .header-box-content {
                display: flex;
                margin-right: 15px;
                align-items: center;
                color: #606266;
                margin-bottom: 10px;
                &-title {
                    margin-right: 2px;
                    white-space: nowrap;
                }
                .header-box-title {
                    white-space: nowrap;
                    margin-right: 3px;
                }
            }
        }
        /* 表单 */
        .scope-price {
            width: 50px;
            height: 50px;
        }
        /* 字体高亮 */
        .cursor-font {
            color: rgb(64, 158, 255);
            cursor: pointer;
        }
        /* 分页 */
        .pagination-wrapper {
            cursor: pointer;
            display: flex;
            align-items: center;
            white-space: nowrap;
            padding-top: 10px;
            justify-content: space-between;
            .el-pagination {
            float: right;
            padding: 0;
            background-color: transparent;
            }
            .el-pagage-wrap {
                display: flex;
                width: 100vw;
                align-items: center;
                justify-content: space-between;
                .el-page-box {
                    display: flex;
                    height: 45px;
                    align-items: center;
                    .el-pagage-cont {
                        display: flex;
                        height: 32px;
                        align-items: center;
                        margin-left: 20px;
                        .el-pagage-cursor {
                            color: #20a0ff !important;
                            cursor: pointer;
                        }
                    }
                }
            }
        }
    }
    /* 排序 */
    .sort-wrap {
        display: flex;
        align-items: center;
        cursor: pointer;
        justify-content: center;
        .sort-spliter {
            width: 1px;
            height: 12px;
            background: rgba(235, 235, 235, 1);
            margin: 0 10px;
            }
            .btn-sort {
            font-size: 14px;
            line-height: 1;
            color: #ccc;
            &:hover {
                color: #20a0ff;
            }
        }
    }
    .el-button-left {
        margin-left: 40px;
    }
    .el-button-right {
        margin-right: 10px;
    }
    .curse-add {
        width: 100%;
        display: inline-block;
        height: 17px;
        text-align: center;
        margin-left: 0 !important;
        padding: 4px !important;
    }
    .el-tag-school {
        display: flex;
        width: 100%;
        flex-wrap: wrap;
        margin-bottom: 10px;
        .el-tag{
            margin-right: 10px;
            margin-bottom: 10px;
            height: 32px;
            display: flex;
            align-items: center;
        }
    }
    .el-school-filter {
        display: flex;
        height: 32px;
        align-items: center;
        margin-top: 15px;
    }
    .dialogVisibleSale {
        .title {
            font-size: 12px;
            color: #999;
            position: absolute;
            top: 16px;
            left: 128px;
        }
        .sale_wrap {
            display: flex;
            flex-direction: column;
            box-sizing: border-box;
            padding: 0 40px;
            .header {
                height: 14px;
                display: flex;
                align-items: center;
                justify-content: space-between;
                margin-bottom: 33px;
                .header_title, .header_number {
                    color: #333;
                    font-size: 14px;
                    white-space: nowrap;
                }
                .header_title {
                    width: 600px;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }
            }
        }
        .dialog-footer {
            display: flex;
            justify-content: center;
            margin-top: 32px;
        }
    }
</style>
<style lang="less">
    .shopPeoPle .el-table__body-wrapper .el-table__body .el-table__row td {
        border-right: none;
    }
    .shopPeoPle .el-table__header-wrapper .el-table__header .has-gutter tr th {
        border-right: none;
    }
    .shopPeoPle .el-table .el-table_1_column_6  .cell {
        position: relative;
    }
    .shopPeoPle .el-range-editor--small .el-range-separator{
        padding: 0 1px !important;
    }
    .shopPeoPle .school-list {
        .el-checkbox-button {
        margin-right: 10px;
        margin-bottom: 10px;
        border-radius: 0;
        }
        .el-checkbox-button:first-child .el-checkbox-button__inner {
            border-radius: 2;
        }
        .el-checkbox-button__inner {
            border-left: 1px solid #dcdfe6;
            font-size: 12px;
            font-weight: 400;
            color: rgba(126, 137, 147, 1);
            border-radius: 2px;
            position: relative;
        }
        .el-checkbox-button.is-checked .el-checkbox-button__inner {
            background-color: #fff;
            border: 1px solid rgba(32, 160, 255, 1);
            color: #20a0ff;
            box-shadow: none;
            overflow: hidden;
            &::after {
                content: " ";
                position: absolute;
                bottom: 0;
                right: 0;
                width: 24px;
                height: 18px;
                background-image: url(//cdn.zsdx.cn/admin/images/common/checked.png);
                background-position: center;
                background-size: cover;
                background-repeat: no-repeat;
            }
        }
    }
    .shopPeoPle {
        .el-dialog__header {
            padding-top: 10px;
            box-shadow:0px 1px 0px 0px rgba(233,233,233,1);
            display: flex;
            align-items: center;
            background: #FAFAFA;
            border-radius: 4px 4px 0 0;
            .el-dialog__title {
                font-weight: 500;
                color: #333;
                font-size: 14px;
            }
            .el-icon-close:before {
                color: rgb(194,194,194);
                font-size: 17px;
                font-weight: bold;
            }
            .el-dialog__headerbtn {
                top: 14px;
            }
        }
    }
    .popoverMain {
        width: 400px !important;
    }
</style>
